//
//  WZPNewViewController.m
//  WZPItem
//
//  Created by 王王喆平 on 16/7/3.
//  Copyright © 2016年 UI. All rights reserved.
//

#import "WZPNewViewController.h"
#import "WZPSubTagViewController.h"
#import "WZPAllViewController.h"
#import "WZPVideoViewController.h"
#import "WZPVoiceViewController.h"
#import "WZPPictureViewController.h"
#import "WZPTextViewController.h"
@interface WZPNewViewController ()

@end

@implementation WZPNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = WZPColor;
    [self setNavigation];
    [self setUpAllChileVeiwController];
}

-(void)setUpAllChileVeiwController{
    
    WZPAllViewController * allView = [[WZPAllViewController alloc]init];
    allView.title = @"全部";
    [self addChildViewController:allView];
    
    WZPVideoViewController * videoView = [[WZPVideoViewController alloc]init];
    videoView.title = @"视频";
    [self addChildViewController:videoView];
    
    WZPVoiceViewController * voiceView = [[WZPVoiceViewController alloc]init];
    voiceView.title = @"声音";
    [self addChildViewController:voiceView];
    
    WZPPictureViewController *pictureView = [[WZPPictureViewController alloc]init];
    pictureView.title = @"图片";
    [self addChildViewController:pictureView];
    
    WZPTextViewController * textView = [[WZPTextViewController alloc]init];
    textView.title = @"段子";
    [self addChildViewController:textView];
    
}

// 设置标题
-(void)setNavigation{
    self.navigationItem.titleView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"MainTagSubIcon"] hlightImage:[UIImage imageNamed:@"MainTagSubIconClick"] target:self action:@selector(dian)];
}
-(void)dian{
    WZPSubTagViewController *  subTag = [[WZPSubTagViewController alloc]init];
    // 跳转到推荐页
    [self.navigationController pushViewController:subTag animated:YES];
    
}
@end
